Skip to content

[INTF25] Build filter for fetch review dashboard query#83

Open
ruiichen wants to merge 8 commits intomainfrom
INTF25-review-dashboard-query-filter
Open

[INTF25] Build filter for fetch review dashboard query#83
ruiichen wants to merge 8 commits intomainfrom
INTF25-review-dashboard-query-filter

Conversation

@ruiichen
Copy link
Collaborator

@ruiichen ruiichen commented Nov 5, 2025

Notion ticket link

Ticket Name

Implementation description

  • Added a new type for the filter's possible selections
  • Added a new relation to access the position table as well (needed for departments)
  • Added a filter factory to create the condition used in the where condition.
  • Note: I did not add a filter for selected applicants/conflicts in this PR because the support is not yet there in our database. Adding it once given support is trivial using the current implementation.

Steps to test

  1. In PGAdmin4, change the values of the entries in tables such as applicants and applicant_records, and filter for that record in the GraphQL query. Below is the query template.
  2. I also tested myself, the tests I have tried are included for your viewing pleasure.
query {
  reviewDashboard(pageNumber: 1, resultsPerPage: 50, filter: null) {
    firstName
    lastName
		position
    timesApplied
    applicationStatus
    choice
    reviewers {
      firstName
      lastName
    }
    totalScore
  }
}

image image image image image image image image image image

What should reviewers focus on?

  • Logic in the where condition is correct

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@ruiichen ruiichen self-assigned this Nov 5, 2025
@ruiichen ruiichen force-pushed the INTF25-review-dashboard-query-filter branch from 7ddb85e to b4f17ba Compare November 5, 2025 01:49
@mxc-maggiechen mxc-maggiechen marked this pull request as draft November 19, 2025 02:55
@ruiichen ruiichen force-pushed the INTF25-review-dashboard-query-filter branch from ce4d304 to 1b0f5a7 Compare November 22, 2025 19:06
@ruiichen ruiichen marked this pull request as ready for review November 26, 2025 01:16
ruiichen added 6 commits November 29, 2025 13:41
# Conflicts:
#	backend/typescript/graphql/resolvers/reviewDashboardResolvers.ts
#	backend/typescript/graphql/types/reviewDashboardType.ts
#	backend/typescript/services/implementations/reviewDashboardService.ts
#	backend/typescript/services/interfaces/IReviewDashboardService.ts
@ruiichen ruiichen force-pushed the INTF25-review-dashboard-query-filter branch from 9b0c437 to 80878d6 Compare November 29, 2025 18:45
Comment on lines 53 to 93
if (filter.role) {
if (filter.role.toString() === "int_dir") {
exp.push({ position: { [Op.eq]: "Internal Director" } });
} else if (filter.role.toString() === "ext_dir") {
exp.push({ position: { [Op.eq]: "External Director" } });
} else if (filter.role.toString() === "pres") {
exp.push({ position: { [Op.eq]: "President" } });
} else if (filter.role.toString() === "vpe") {
exp.push({ position: { [Op.eq]: "VP Engineering" } });
} else if (filter.role.toString() === "vpd") {
exp.push({ position: { [Op.eq]: "VP Design" } });
} else if (filter.role.toString() === "vpp") {
exp.push({ position: { [Op.eq]: "VP Product" } });
} else if (filter.role.toString() === "vpt") {
exp.push({ position: { [Op.eq]: "VP Talent" } });
} else if (filter.role.toString() === "vp_ext") {
exp.push({ position: { [Op.eq]: "VP External" } });
} else if (filter.role.toString() === "vp_int") {
exp.push({ position: { [Op.eq]: "VP Internal" } });
} else if (filter.role.toString() === "vp_comms") {
exp.push({ position: { [Op.eq]: "VP Community" } });
} else if (filter.role.toString() === "vp_scoping") {
exp.push({ position: { [Op.eq]: "VP Scoping" } });
} else if (filter.role.toString() === "vp_finance") {
exp.push({ position: { [Op.eq]: "VP Finance" } });
} else if (filter.role.toString() === "pm") {
exp.push({ position: { [Op.eq]: "Project Manager" } });
} else if (filter.role.toString() === "pl") {
exp.push({ position: { [Op.eq]: "Project Lead" } });
} else if (filter.role.toString() === "design_mentor") {
exp.push({ position: { [Op.eq]: "Design Mentor" } });
} else if (filter.role.toString() === "graphic_design") {
exp.push({ position: { [Op.eq]: "Graphic Design" } });
} else if (filter.role.toString() === "product_design") {
exp.push({ position: { [Op.eq]: "Product Design" } });
} else if (filter.role.toString() === "uxr") {
exp.push({ position: { [Op.eq]: "User Researcher" } });
} else if (filter.role.toString() === "dev") {
exp.push({ position: { [Op.eq]: "Developer" } });
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do you feel if we just pass in a position string instead of making GraphQL guard with an enum. if we can't find anything entries with matching position string, we just return empty array. just looking at this term, we added i think 2 new positions, i think doing it without this enum check would make it easier to add new positions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think we can also do multi-select positions for filtering? i think i see that in the design right now, so it would be good to have that option if it's not too bad to implement 🙏

Copy link
Member

@ericahan22 ericahan22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! But maybe remove the .idea files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants